#include "WorkQueue.h"

namespace OCPP
{
	uint16 WorkQueue::getChannel(const String& channelName)
	{
		CORE_LOCK_MUTEX(mChannelMapMutex);

		ChannelMap::iterator i = mChannelMap.find(channelName);
		if (i == mChannelMap.end())
		{
			i = mChannelMap.insert(ChannelMap::value_type(channelName, mNextChannel++)).first;
		}
		return i->second;
	}
}